<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>http::file_body</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__http__response.html" title="http::response">
<link rel="next" href="boost__beast__http__fields.html" title="http::fields">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__response.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__fields.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__http__file_body"></a><a class="link" href="boost__beast__http__file_body.html" title="http::file_body">http::file_body</a>
</h4></div></div></div>
<p>
        <a class="indexterm" name="idm79903"></a>
      </p>
<p>
        A message body represented by a file on the filesystem.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.synopsis"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/file_body.hpp" target="_top">boost/beast/http/file_body.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">file_body</span> <span class="special">=</span> <span class="identifier">basic_file_body</span><span class="special">&lt;</span> <span class="identifier">file</span> <span class="special">&gt;;</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.types"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.types">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body/file_type.html" title="http::basic_file_body::file_type">file_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The type of File this body uses.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__reader.html" title="http::basic_file_body::reader">reader</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Algorithm for storing buffers when parsing.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__value_type.html" title="http::basic_file_body::value_type">value_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The type of the <a class="link" href="boost__beast__http__message/body.html" title="http::message::body"><code class="computeroutput"><span class="identifier">message</span><span class="special">::</span><span class="identifier">body</span></code></a> member.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__writer.html" title="http::basic_file_body::writer">writer</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Algorithm for retrieving buffers when serializing.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.static_member_functions"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.static_member_functions">Static
        Member Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body/size.html" title="http::basic_file_body::size">size</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns the size of the body.
                </p>
              </td>
</tr></tbody>
</table></div>
<p>
        Messages with this type have bodies represented by a file on the file system.
        When parsing a message using this body type, the data is stored in the file
        pointed to by the path, which must be writable. When serializing, the implementation
        will read the file and present those octets as the body content. This may
        be used to serve content from a directory as part of a web service.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.template_parameters"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.template_parameters">Template
        Parameters</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Type
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <code class="computeroutput"><span class="identifier">File</span></code>
                </p>
              </td>
<td>
                <p>
                  The implementation to use for accessing files. This type must meet
                  the requirements of <span class="emphasis"><em>File</em></span>.
                </p>
              </td>
</tr></tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h4"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.types0"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.types0">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/native_handle_type.html" title="file::native_handle_type">native_handle_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The type of the underlying file handle.
                </p>
              </td>
</tr></tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__file_body.h5"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.member_functions"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.member_functions">Member
        Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/close.html" title="file::close">close</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Close the file if open.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/is_open.html" title="file::is_open">is_open</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns <code class="computeroutput"><span class="keyword">true</span></code> if the
                  file is open.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/native_handle.html" title="file::native_handle">native_handle</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Returns the native handle associated with the file. <br> <span class="silver">—</span><br> Set the native handle associated
                  with the file.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/open.html" title="file::open">open</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Open a file at the given path with the specified mode.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/pos.html" title="file::pos">pos</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return the current position in the open file.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/read.html" title="file::read">read</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Read from the open file.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/seek.html" title="file::seek">seek</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Adjust the current position in the open file.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/size.html" title="file::size">size</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return the size of the open file.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__file/write.html" title="file::write">write</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Write to the open file.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<p>
        This alias is set to the best available implementation of <span class="emphasis"><em>File</em></span>
        given the platform and build settings.
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
      Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__response.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__fields.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
